import com.sun.tools.javac.util.StringUtils;

public class 最大奇数问题 {

    public static void main(String[] args) {
        String[] strList="35427".split("");;


        System.out.println(adapter(strList,new StringBuilder(),"0",0));

    }
    public static String adapter(String[] strList,StringBuilder sb,String max,int first){
        System.out.println(sb.toString());
        if( (!"".equals(sb.toString()))&&Integer.valueOf(sb.toString())%2>0
                &&Integer.valueOf(sb.toString())>Integer.valueOf(max)){
            max=sb.toString();
        }
        for(int i=first;i<strList.length;i++){
            if(sb.toString().contains(strList[i])){
                continue;
            }
            sb.append(strList[i]);
            max=adapter(strList,sb,max,first++);
            sb.deleteCharAt(sb.length()-1);
        }
        return max;
    }

}
